
#include <conio.h>
#include "DeclareFile.h"

int SCREEN_WIDTH = 800;
int SCREEN_HEIGHT = 600;

// 绘制按钮
void drawButton(int x, int y, const char* text) {

    setlinestyle(PS_SOLID, 0.5);
    setlinecolor(BLACK);
    rectangle(x, y, x + BUTTON_WIDTH, y + BUTTON_HEIGHT);

    settextcolor(TEXT_COLOR);
    settextstyle(20, 0, "Arial");

    // 计算居中
    int textX = x + (BUTTON_WIDTH - textwidth(text)) / 2;
    int textY = y + (BUTTON_HEIGHT - textheight(text)) / 2;
    outtextxy(textX, textY, text);
}
bool isMouseInButton(int mouseX, int mouseY, int buttonX, int buttonY) {
    return (mouseX >= buttonX && mouseX <= buttonX + BUTTON_WIDTH &&
        mouseY >= buttonY && mouseY <= buttonY + BUTTON_HEIGHT);
}

void Pause() {

	BeginBatchDraw();

    setbkcolor(WHITE);

    cleardevice();
    putimage(BUTTON_X, BUTTON_Y_2 + 3, &SetImg);
    drawButton(BUTTON_X, BUTTON_Y_1, "继续游戏");
    drawButton(BUTTON_X, BUTTON_Y_2, "设置");
    drawButton(BUTTON_X, BUTTON_Y_3, "退出游戏");

	FlushBatchDraw();
}